package com.yhp.web.userweb;

import com.yhp.bo.UsersBO;
import com.yhp.pojo.Users;
import com.yhp.service.userservice.CenterUserService;
import com.yhp.utils.JSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "用户中心",tags = {"用户中心展示的相关接口"})
@RestController
@RequestMapping("/center")
public class CenterController {
    @Autowired
    private CenterUserService centerUserService;

    //查询用户信息
    @ApiOperation(value = "获取用户信息",notes = "获取用户信息",httpMethod = "POST")
    @PostMapping("/userInfo")
    public JSONResult getUserInfo(
            @ApiParam(name = "userId",value = "用户id",required = true)
            String userId){
        Users users = centerUserService.queryUserInfo(userId);
        return JSONResult.ok(users);
    }

}
